package cn.cvs.dao;

import cn.cvs.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {

	/**
	 * 增加用户信息
	 * @param sysUser
	 * @return
	 * @throws Exception
	 */
	public int add(SysUser sysUser)throws Exception;

	/**
	 * 通过userCode获取User
	 * @param account
	 * @return
	 * @throws Exception
	 */
	public SysUser getLoginUser(@Param("account") String account,@Param("password") String password)throws Exception;

	/**
	 * 通过条件(用户名,角色ID)查询-userList
	 * @param realName
	 * @param RoleId
	 * @return
	 * @throws Exception
	 */
	public List<SysUser> selectList(@Param("realName") String realName,@Param("RoleId") int RoleId)throws Exception;

	/**
	 * 通过条件(用户名,角色ID)查询-用户表记录数
	 * @param realName
	 * @param RoleId
	 * @return
	 * @throws Exception
	 */
	public int selectCount(@Param("realName") String realName,@Param("RoleId") int RoleId)throws Exception;
	
	/**
	 * 通过userId删除user
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteUserById(Integer id)throws Exception;
	
	/**
	 * 通过userId获取user
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public SysUser getUserById(int id)throws Exception;
	
	/**
	 * 修改用户信息
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public int modify(SysUser user)throws Exception;

	/**
	 * 修改当前用户密码
	 * @param id
	 * @param password
	 * @return
	 * @throws Exception
	 */
	public int updatePwd(@Param("id") int id,@Param("password") String password)throws Exception;

}
